<?php
class UsersController extends AppController {

    function add() {        
        $groups = Set::combine(ClassRegistry::init('Group')->find('all', array('recursive' => -1)), '{n}.Group.id', '{n}.Group.name');  
        $this->set('groups', $groups);
        return parent::add();
    }
    
    function view($id = null) {
        return parent::view($id);
    }
    
    function index() {
        return parent::index();
    }
    
    function edit($id = null) {
        $groups = Set::combine(ClassRegistry::init('Group')->find('all', array('recursive' => -1)), '{n}.Group.id', '{n}.Group.name');  
        $this->set('groups', $groups);
        return parent::edit($id);
    }
    
    function delete($id) {
        return parent::delete($id);
    }
    
    function login() {
//           d($this->data);
    }

    function logout() {
        $this->redirect($this->Auth->logout());
    }
    
//     function beforeFilter() {
//         parent::beforeFilter(); 
//         $this->Auth->allowedActions = array('*');
//     }

    
}
?>